package com.zhongkun.service.impl;

import com.zhongkun.mapper.FileMapper;
import com.zhongkun.pojo.Comment;
import com.zhongkun.pojo.Picture;
import com.zhongkun.pojo.User;
import com.zhongkun.pojo.UserShare;
import com.zhongkun.service.FileMapperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FileMapperServiceImpl implements FileMapperService {

    @Autowired
    private FileMapper fileMapper;

    //获取用户头像
    @Override
    public Picture getProfile(User user) {
        return fileMapper.getProfile(user.getProfile());
    }

    //获取所有图库
    @Override
    public List<Picture> getAllPicture(){
        return fileMapper.getAllPicture();
    }

    //获取所有动态 时间倒序
    @Override
    public List<UserShare> getAllShareByTime() {
        return fileMapper.getAllShareByTime();
    }

    //获取所有动态 热度倒序
    @Override
    public List<UserShare> getAllShareByHot() {
        return fileMapper.getAllShareByHot();
    }

    //获取所有的评论
    @Override
    public List<Comment> getAllShareCommentByTime() {
        return fileMapper.getAllShareCommentByTime();
    }
}
